<?php
if (isset($_SESSION['ids']) && isset($_POST['t']) && !empty($_POST['data'])){
$data=str_replace(' ','+', $_POST['data']);
$baseString=explode(',', $data);
$data=base64_decode($baseString[1]);
file_put_contents('./upload/'.$_SESSION['ids'].'-'.$_POST['t'].'.jpg',$data);
    
echo json_encode(array('status'=>'ok'));
     
    
}
